<button>点击获取角色的列表</button>
<ul></ul>
<script src="./ajax.js"></script>
<script>
    document.querySelector('button').onclick = function(){
        get(
        'https://m.maizuo.com/gateway',
        {
            cityId: 110100,
            pageNum: 1,
            pageSize: 10,
            type: 1,
            k: 9390772
        },
        res => {
            console.log('拿到数据：', res)
            document.querySelector('ul').innerText = ''

            res.data.films.forEach((item, i) => {
                let liObj = document.createElement('li')
                liObj.innerHTML = `
                    ${item.name}
                    <img src="${item.poster}" width="200" />
                `
                document.querySelector('ul').appendChild(liObj)
            })
        },
        'json',
        {
            'X-Client-Info':'{"a":"3000","ch":"1002","v":"5.2.0","e":"16525006601241743764750337","bc":"110100"}',
            'X-Host': 'mall.film-ticket.film.list',
            'X-Requested-With':'XMLHttpRequest',
            'X-Token':'undefined',
        }
    )
}
</script>